import { defineConfig } from 'vitest/config'
import vue from '@vitejs/plugin-vue'
import { resolve } from 'path'
import tsconfigPaths from 'vite-tsconfig-paths'

export default defineConfig({
  plugins: [vue(), tsconfigPaths()],
  test: {
    globals: true,
    environment: 'happy-dom',
    setupFiles: ['./test/setup.ts']
  },
  resolve: {
    alias: {
      '~': resolve(__dirname, '.'),
      '~/*': resolve(__dirname, './*'),
      '~/assets': resolve(__dirname, 'assets'),
      '~/assets/css': resolve(__dirname, 'assets/css'),
      '~/stores': resolve(__dirname, 'stores'),
      '~/utils': resolve(__dirname, 'utils'),
      '~/pages': resolve(__dirname, 'pages'),
      '~/layouts': resolve(__dirname, 'layouts'),
      '@': resolve(__dirname, '.'),
      '@/*': resolve(__dirname, './*'),
      '@/assets': resolve(__dirname, 'assets'),
      '@/assets/css': resolve(__dirname, 'assets/css'),
      '@/stores': resolve(__dirname, 'stores'),
      '@/utils': resolve(__dirname, 'utils'),
      '@/pages': resolve(__dirname, 'pages'),
      '@/layouts': resolve(__dirname, 'layouts')
    }
  }
})